using System.Data.Entity.ModelConfiguration;
using LAMSDK.Security.Entities;

namespace LAMSDK.Security.Mapping
{
	public class DepartmentMap : EntityTypeConfiguration<Department>
	{
		public DepartmentMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.DeptCode)
				.HasMaxLength(255);
				
			this.Property(t => t.DeptName)
				.HasMaxLength(255);
				
			// Table & Column Mappings
			this.ToTable("Department");
			this.Property(t => t.Id).HasColumnName("DeptId");
			this.Property(t => t.DeptCode).HasColumnName("DeptCode");
			this.Property(t => t.DeptName).HasColumnName("DeptName");
		}
	}
}

